package com.jeff.android.lab.android.lifecycle;

import com.jeff.android.lab.BaseRecyclerViewFragment;
import com.jeff.android.lab.algorithm.BubbleSortFragment;
import com.jeff.android.lab.algorithm.FibonacciFragment;
import com.jeff.android.lab.algorithm.QuickSortFragment;
import com.jeff.android.lab.android.lifecycle.lifecycle.LifeCycleActivity;
import com.jeff.android.lab.android.lifecycle.livedata.LiveDataActivity;
import com.jeff.android.lab.android.lifecycle.viewmodel.ViewModelActivity;
import com.jeff.android.lab.util.RouterUtil;

import java.util.ArrayList;
import java.util.List;

public class LifecycleFragment extends BaseRecyclerViewFragment {

    @Override
    protected List<String> getData() {
        return new ArrayList<String>() {
            {
                add("LiveCycle");
                add("LiveData");
                add("ViewModel");
            }
        };
    }

    @Override
    protected void launch(String widget) {
        if ("LiveCycle".equals(widget)) {
            RouterUtil.launchActivity(getContext(), LifeCycleActivity.class);
        } else if ("LiveData".equals(widget)) {
            RouterUtil.launchActivity(getContext(), LiveDataActivity.class);
        } else if ("ViewModel".equals(widget)) {
            RouterUtil.launchActivity(getContext(), ViewModelActivity.class);
        }
    }

}
